package com.xsmart.payment.api;

import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.payment.services.PaymentConfigruationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/api")
public class PaymentConfigruationController {
    @Autowired
    PaymentConfigruationService paymentConfigruationService;

    /**
     * 查询支付配置
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/PaymentConfigruationService/queryPaymentConfigruation", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean queryPaymentConfigruation(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        System.out.print("aaaaa");
        return paymentConfigruationService.queryPaymentConfigruation(requestBean);
    }

    /**
     * 查询全部的支付配置
     *
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/PaymentConfigruationService/queryAllPaymentConfigruation", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean queryAllPaymentConfigruation(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return paymentConfigruationService.queryAllPaymentConfigruation(requestBean);
    }

    /**
     * 新增
     *
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/PaymentConfigruationService/addPaymentConfigruation")
    @ResponseBody
    public ResponseBean addPaymentConfigruation(@ModelAttribute RequestBean requestBean, HttpServletRequest request){
        return paymentConfigruationService.addPaymentConfigruation(requestBean);
    }

    /**
     * 改
     *
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/PaymentConfigruationService/modPaymentConfigruation", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean modPaymentConfigruation(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return paymentConfigruationService.modPaymentConfigruation(requestBean);
    }

    /**
     * 删
     *
     * @param requestBean
     * @param request
     * @return
     */
    @RequestMapping(value = "/v1/PaymentConfigruationService/delPaymentConfigruation", method = RequestMethod.POST)
    @ResponseBody
    public ResponseBean delPaymentConfigruation(@ModelAttribute RequestBean requestBean, HttpServletRequest request) {
        return paymentConfigruationService.delPaymentConfigruation(requestBean);
    }

}
